package feizhou.untils.tools;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Properties;

/**
 * @ClassName: PropertyUtil
 * @Description 请描述下该类是做什么的
 * @Author feizhou
 * @Date 2023/9/9  12:16
 * @Verson 1.0
 **/
public class PropertyUtil {


    /**
     * 获取Properties
     * @param filePath  文件路径
     * @return 返回Properties
     * @author  <a href="920786312@qq.com">周飞</a>
     * @since 2023/9/9 12:25
     */
    public static Properties getProperties(String filePath) {
        // 把文件中的数据加载到集合中
        Properties prop = new Properties();
        Reader r = null;
        try {
            r = new FileReader(filePath);
            prop.load(r);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e2) {
            e2.printStackTrace();
        } finally {
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return prop;

    }

 
}